$(function(){
    var fid = $('#view-content').attr('fid');;
    var baseurl = $('#view-content').attr('baseurl');

    $.get(baseurl+'/images/floors/getfloor.php',{fid:fid},function(data){
        $('#view-content #image').html(data);
    });

    $('.data').click(function(){
        var vid = $(this).parent().attr('vid');
        window.location = baseurl + '/backend/venue/details/vid/' + vid;
    });

    $('#link-delete').click(function(e){
        e.preventDefault();

        if(!confirm('Delete this floor?')){
            return;
        }

        var fid = $(this).attr('fid');
        $('#frmFloorDelete #fid').val(fid);
        $('#frmFloorDelete').submit();
    });

    $('.link-delete').click(function(e){
        e.preventDefault();

        var vname = $(this).parent().siblings('#vname').text();
        if(!confirm('Delete ' + vname + '?')){
            return;
        }

        var vid = $(this).attr('vid');
        $('#frmVenueDelete #vid').val(vid);
        $('#frmVenueDelete').submit();
    });
});